<template>
    <div class="subject">
      <span>{{ num1 }}</span>
      <span>+</span>
      <span>{{ num2 }}</span>
      <span>=</span>
      <input type="number" v-model.number.trim="text"/>
      <button @click="todos">提交</button>
    </div>
  </template>
  
  <script>
    import Bus from '@/utils/EventBus';
  export default {
    data(){
        return {
            text:''
        }
    },
    props:{
    num1:Number,
    num2:Number,
    index:Number
   },
   methods:{
    todos(){
        Bus.$emit('sendMsg', {num1:this.num1,num2:this.num2,text:this.text,index:this.index})
    }
   }
  };
  </script>
  
  <style scoped>
  .subject {
    margin: 5px;
    padding: 5px;
    font-size: 20px;
  }
  .subject span {
    display: inline-block;
    text-align: center;
    width: 20px;
  }
  .subject input {
    width: 50px;
    height: 20px;
  }
  </style>